<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head>
    <link rel="shortcut icon" href="favicon.ico">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/layui.css}" rel="stylesheet" >
    <link th:href="@{/css/font-awesome.css}" rel="stylesheet"/>
    <!-- bootstrap-table 表格插件样式 -->
    <link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
    <link th:href="@{/ajax/libs/jqTreeGrid/jquery.treegrid.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.css}" rel="stylesheet"/>
    <link th:href="@{/css/checkbox.css}" rel="stylesheet"/>
    <link th:href="@{/ajax/libs/select/select2.css}" rel="stylesheet"/>
    <link th:href="@{/ruoyi/css/ry-ui.min.css}" rel="stylesheet"/>
    <link href="/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <input name="id"  type="hidden"  th:value="${attendId}" />
    <form class="form-horizontal m" id="form-user-edit">
        <div class="form-group">
            <label class="col-sm-3 control-label ">早打卡：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="morning" id="morning" placeholder="请输入 0000-00-00 00:00:00 格式"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">晚打卡：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="evening" id="evening" placeholder="请输入 0000-00-00 00:00:00 格式" >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">补签理由：</label>
            <div class="col-sm-8">
                <textarea class="form-control" name="comment" id="comment"/>
            </div>
        </div>
        <div class="form-group">
            <div class="form-control-static col-sm-offset-9">
                <button type="button" onclick="edit()" class="btn btn-primary">提交</button>
                <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
            </div>
        </div>
    </form>
</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<!-- bootstrap-table 表格插件 -->
<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js}"></script>
<!-- Data Tables -->
<script th:src="@{/js/plugins/dataTables/jquery.dataTables.js}"></script>
<script th:src="@{/js/plugins/dataTables/dataTables.bootstrap.js}"></script>
<script th:src="@{/js/plugins/jeditable/jquery.jeditable.js}"></script>
<script th:src="@{/js/plugins/layer/laydate/laydate.js}"></script>
<script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js?v=2.2.0}"></script>
<script th:src="@{/ruoyi/js/yuyu-ui.min.js?v=2.2.0}"></script>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script th:src="@{/ajax/libs/select/select2.js}"></script>
<script>
    function edit() {
        var id = $("input[name='id']").val();
        var morning = $("input[name='morning']").val();
        var evening = $("input[name='evening']").val();
        var comment = $("textarea[name='comment']").val();
        var json={
            "attendId": id,
            "reAttendMor": morning,
            "reAttendEve": evening,
            "comment": comment
        };
        $.ajax({
            url: "/reattend",
            type: "post",
            data: JSON.stringify(json),
            dataType: "json",
            contentType:"application/json",
            success: function (data) {
                if (data.code==200) {
                    parent.layer.msg('补签申请成功', {icon: 1});
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
            }
        });
    }
</script>
</body>
</html>
